package com.atguigu.common.valid;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented
//注解使用哪个校验器进行校验
@Constraint(
        validatedBy = {ListValueConstraintValidator.class}
)
//可标注的位置
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE,
        ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
//在运行时获取
@Retention(RetentionPolicy.RUNTIME)

public @interface ListValue {
    //错误信息
    String message() default "{com.atguigu.common.valid.ListValue.message}";

    //支持分组校验
    Class<?>[] groups() default {};

    //负载
    Class<? extends Payload>[] payload() default {};

    int[] vals() default {};

}
